const log4js = require('log4js');

log4js.configure({
  appenders: { 
    dateFile: { 
      type: "dateFile",
      encoding: 'utf-8',
      pattern: "yyyy-MM-dd",
      filename: "./logs/make-money.log",
      keepFileExt: true,
      alwaysIncludePattern: true
    },
    stdout: { type: 'stdout' }
  },
  categories: { default: { appenders: ["dateFile", "stdout"], level: "debug" } },
});


function getLogger(name) {
  return log4js.getLogger(name)
}

module.exports = {getLogger}